Skip to content

fix: ignore "Bad file descriptor" on close - #230

Merged
bogovicj merged 1 commit into
masterfrom
ignoreBadFileDescriptorOnClose
Jul 17, 2026
Merged

fix: ignore "Bad file descriptor" on close#230
bogovicj merged 1 commit into
masterfrom
ignoreBadFileDescriptorOnClose

Conversation

@cmhulbert

Copy link
Copy Markdown
Contributor

Sometimes (seemingly only on MacOs, when accessing blocks over a SMB mount), reading through a FileSystem KVA succeeds, but closing throws a "Bad file descriptor" IOException.
Since the read succeeded, we are willing to ignore this exception.

This has not been thoroughly investigated, but a few things seem to be true that indicate it's related to the SMB mount:

  • This doesn't happen right away, but when it does happen, it continues to happen frequently, even across processes (i.e. relaunching the same script/test).
  • When it does happen, unmounting and remounting can resolve this, even during the runtime of an application (presuming the application doesn't try to read/write while it's unmounted)

@bogovicj bogovicj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the Exception on close is harmless, I think this is the best we can do.

@bogovicj
bogovicj merged commit 7f9fb29 into master Jul 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants